import PlayerBee from "../EntityHoneyBee/PlayerBee";

export default class HoneyBeesTypeManager {

    private static _Instance: HoneyBeesTypeManager;
    private constructor() { }
    //公开的方法
    public static get Instance(): HoneyBeesTypeManager {
        if (!this._Instance) {
            this._Instance = new HoneyBeesTypeManager();
            this._Instance.InitType();
        }
        return this._Instance;
    }
    /**
     * @param HoneyBeesTypeMap 蜜蜂类型Map
     */
    HoneyBeesTypeMap: Map<string, any> = new Map<string, any>();

    private InitType() {
        this.HoneyBeesTypeMap.set("PlayerBee", PlayerBee);

    }

    /**获取所有蜜蜂类型 */
    GetSoliderTypeArray(): Map<string, any> {

        return this.HoneyBeesTypeMap;
    }
    /**
        * @param DoesTheObstanleTypeExist 检测是否拥有当前名称的蜜蜂类型
        * @param TypeName 
        */
    DoesTheTypeExist(TypeName: string): boolean {

        if (this.HoneyBeesTypeMap.has(TypeName)) {
            return true;
        }
        return false;
    }

    /**
     * @param GetTypeByName 根据名称获取类型
     * @param TypeName      //与类型相同的字符串
     */
    GetTypeByName(TypeName: string): any {

        if (this.HoneyBeesTypeMap.has(TypeName)) {

            return this.HoneyBeesTypeMap.get(TypeName);
        }
        return null;
    }
}